package com.zhengxin.service.impl;

import java.io.Serializable;
import java.util.List;

import com.zhengxin.dao.ICustomerDao;
import com.zhengxin.pojo.Customer;
import com.zhengxin.service.ICustomerService;

public class CustomerService implements ICustomerService {

	private ICustomerDao customerDao;
	
	public ICustomerDao getCustomerDao() {
		return customerDao;
	}

	public void setCustomerDao(ICustomerDao customerDao) {
		this.customerDao = customerDao;
	}

	@Override
	public void save(Customer t) {
		customerDao.save(t);
	}

	@Override
	public Customer findByid(Serializable id) {
		return customerDao.findByid(id);
	}

	@Override
	public List<Customer> getAll() {
		return customerDao.getAll();
	}

	@Override
	public void update(Customer t) {
		customerDao.update(t);
	}

	@Override
	public void delete(Serializable id) {
		customerDao.delete(id);
	}

	@Override
	public List<Customer> getByStatus(int status) {
		String hql="from Customer where status=?";
		return customerDao.getByCondition(hql, status);
	}



}
